class EventManage{
    private eventList: EventList;
    //执行事件
    public executeEvent(eventName:string){
        const event = this.eventList[eventName];
        event&&event();
    }
    public executeEventParams(eventName:string,...params:any){
        const event = this.eventList[eventName];
        event&&event(...params);
    }
    public addEvent(eventName:string,event:Function){
        this.eventList[eventName] = event;
    }
    //
    constructor(){
        this.eventList = {};
    }
}
const eventManage = new EventManage();
export default eventManage;
interface EventList{
    [key:string]:Function;
}
